package cn.com.cetccst.mdm.engine;

import android.app.Activity;
import android.content.ComponentName;

import java.util.List;

public interface IMDMEngine {
    void config(ComponentName adminComponent, String fileProviderAuthority, BaseMDMEngine.Callback logger);

    boolean isActiveDeviceAdmin();

    boolean setActiveDeviceAdmin(Activity activity);

    boolean removeDeviceAdmin();

    //蓝牙使用限制
    void controlBluetooth(boolean disabled);

    boolean isBluetoothControlled();

    boolean setBluetoothWhiteList(List<String> whitList);

    List<String> getBluetoothWhiteList();

    //相机使用限制
    void controlCamera(boolean disabled);

    boolean isCameraControlled();

    //wifi使用限制
    void controlWifi(boolean disabled);

    boolean isWifiControlled();

    boolean setWifiWhiteList(List<String> whiteList);

    List<String> getWifiWhitList();

    //麦克风使用限制
    void controlMicroPhone(boolean disabled);

    boolean isMicroPhoneControlled();

    //TF/SD卡使用限制
    void controlExternalStorage(boolean disabled);

    boolean isExternalStorageControlled();

    //屏幕截屏限制
    void controlScreenShot(boolean disabled);

    boolean isScreenShotControlled();

    //NFC使用限制
    void controlNFC(boolean disabled);

    boolean isNFCControlled();

    //移动热点限制
    void controlMobileHotSpot(boolean disabled);

    boolean isMobileHotSpotControlled();

    //电话呼出限制
    void controlCallout(boolean disabled);

    boolean isCalloutControlled();

    //短信使用限制
    void controlSms(boolean disabled);

    boolean isSmsControlled();

    //移动数据使用限制
    void controlMobileData(boolean disabled);

    boolean isMobileDataControlled();

    //音量调节限制
    void controlVolumeDown(boolean disabled);

    boolean isVolumeDownControlled();

    //需改时间、时区限制
    void controlAutoTime(boolean disabled);

    boolean isAutoTimeControlled();

    //USB 传输数据限制
    void controlUsbData(boolean disabled);

    boolean isUsbDataControlled();

    //adb调试限制
    void controlUsbDebug(boolean disabled);

    boolean isUsbDebugControlled();

    //禁止恢复出厂设置限制
    void controlRestoreFactory(boolean disabled);

    boolean isRestoreFactoryControlled();

    //禁止系统升级（升个级检测，检测不到新版本）
    void controlSystemUpgrade(boolean disabled);

    boolean isSystemUpgradeControlled();

    //GPS限制
    void controlGPS(boolean disabled);

    boolean isGPSControlled();

    void controlForceGPS(boolean enabled);

    boolean isForceGPSControlled();


    //未知來源
    void controlUnknownSource(boolean disabled);

    boolean isUnknownSourceControlled();

    boolean setUnknownSourceWhiteList(List<String> packages);

    List<String> getUnknownSourceWhiteList();

    //未知來源
    void controlCopyPaste(boolean disabled);

    boolean isCopyPasteControlled();

    //未知來源
    void controlFingerPrint(boolean disabled);

    boolean isFingerPrintControlled();

    //设置禁用应用，如果未空或null，解除禁用
    boolean setDisallowRunningApps(List<String> packageNames, boolean isBlock);

    List<String> getDisallowRunningApps();

    boolean setAllowRunningApps(List<String> packageNames, boolean isBlock);

    List<String> getAllowRunningApps();


    //静默安装apk
    void installPackage(String apkPath);

    //静默卸载app
    void uninstallPackage(String packageName);

    //清除 microSD 卡数据
    void formatSDCard();

    //恢复出厂设置
    void factoryReset();

    //列表内的应用能安装其他应用
    boolean setInstallSourceApps(List<String> packageNames);

    List<String> getInstallSourceApps();

    //设置网络访问白名单应用
    boolean setNetworkWhiteListApps(List<String> packageNames);

    List<String> getNetworkWhiteListApps();

    boolean setNetworkBlackListApps(List<String> packageNames);

    List<String> getNetworkBlackListApps();

    boolean setNetworkWhiteListAddress(List<String> address);

    List<String> getNetworkWhiteListAddress();

    boolean setNetworkBlackListAddress(List<String> address);

    List<String> getNetworkBlackListAddress();

    //设置保活应用，列表内应用不能从任务栏杀死，系统不杀死
    boolean setKeepLiveApps(List<String> packageNames);

    List<String> getKeepLiveApps();

    boolean setUninstallblockApps(List<String> packageNames);

    List<String> getUninstallblockApps();

    boolean setInstallblockApps(List<String> packageNames);

    List<String> getInstallblockApps();


    //列表内应用，有手机管家里的三项启动特权：允许自启动、允许关联启动、允许后台运行，不受电量管理限制
    boolean setSuperApps(List<String> packageNames);

    List<String> getSuperApps();

    //设置开机密码，如果为空，去除开机密码；如果此时在锁屏状态，去除锁屏状态
    boolean setDevicePassword(String password);

    //设置无障碍服务权限
    boolean setPermittedAccessibility(List<String> packageNames);

    List<String> getPermittedAccessibilityServices();

    boolean controlDeviceOwner(boolean enable);

    boolean isDeviceOwnerControlled();

    boolean controlRemoveDeviceAdmin(boolean disabled);

    boolean isRemoveDeviceAdminControlled();

    String getName();

    void controlSingleApp(boolean enable);

    boolean isSingleAppControlled();

    void controlAddUser(boolean disabled);

    boolean isAddUserControlled();

    void shutdown();

    void reboot();

    void powerOnAt(long time);

    String getSN();
}
